package com.dk.service.impl;

import com.alibaba.druid.util.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.dk.mapper.CityMapper;
import com.dk.pojo.Tbcities;
import com.dk.pojo.Tbmodels;
import com.dk.service.CityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CityServiceimpl implements CityService {
    @Autowired
    private CityMapper cityMapper;
    @Override
    public Tbcities getCity(String id) {
        /*java8新特性 方法的引用*/
        LambdaQueryWrapper<Tbcities> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        LambdaQueryWrapper<Tbcities> eq = lambdaQueryWrapper.eq(!StringUtils.isEmpty(id),Tbcities:: getId, id);
        Tbcities tbcities = cityMapper.selectOne(eq);
        return tbcities;
    }
}
